package com.dream.keigezhushou.Activity.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.dream.keigezhushou.Activity.Uiutils.UiUtils;
import com.dream.keigezhushou.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


public class PayFromActivity extends BaseActivity {

    @BindView(R.id.back)
    ImageView mBack;
    @BindView(R.id.textView)
    TextView mTextView;

    @BindView(R.id.paytype_2)
    TextView mPaytype2;
    @BindView(R.id.paytype_3)
    TextView mPaytype3;
    @BindView(R.id.price)
    TextView mPrice;

    @BindView(R.id.paytype_1)
    TextView mPaytype1;
    @BindView(R.id.moneypay)
    ImageView mMoneypay;
    @BindView(R.id.rl_money)
    RelativeLayout mRlMoney;
    @BindView(R.id.wxpay)
    ImageView mWxpay;
    @BindView(R.id.rl_wx)
    RelativeLayout mRlWx;
    @BindView(R.id.zfbpay)
    ImageView mZfbpay;
    @BindView(R.id.rl_alipay)
    RelativeLayout mRlAlipay;
    @BindView(R.id.activity_pay_from)
    LinearLayout mActivityPayFrom;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pay_from);
        ButterKnife.bind(this);



    }


    @OnClick({R.id.back, R.id.paytype_1, R.id.paytype_2, R.id.paytype_3, R.id.pay,R.id.rl_alipay,R.id.zfbpay,R.id.rl_money,R.id.rl_wx})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.paytype_1:
                break;
            case R.id.paytype_2:
                break;
            case R.id.paytype_3:
                break;
            case R.id.pay:
                if(mMoneypay.isSelected()|| mWxpay.isSelected()|| mZfbpay.isSelected()){
                    Intent intent = new Intent(this, SubmitFromActivity.class);
                    startActivity(intent);
                }else{
                    UiUtils.toast("请选择支付方式");
                }

                break;
            case R.id.rl_money:
                mMoneypay.setSelected(true);
                mWxpay.setSelected(false);
                mZfbpay.setSelected(false);
                break;
            case R.id.rl_wx:
                mWxpay.setSelected(true);
                mMoneypay.setSelected(false);

                mZfbpay.setSelected(false);

                break;
            case R.id.rl_alipay:
                mZfbpay.setSelected(true);
                mWxpay.setSelected(false);
                mMoneypay.setSelected(false);



                break;
        }
    }
}
